package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the HOSP_EMER_REGISTRATION database table.
 * 
 */
@Entity
@Table(name="HOSP_EMER_REGISTRATION")
@NamedQuery(name="HospEmerRegistration.findAll", query="SELECT h FROM HospEmerRegistration h")
public class HospEmerRegistration implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="EMER_REGISTRATION_ID")
	private String emerRegistrationId;

	@Temporal(TemporalType.DATE)
	@Column(name="OPERATION_TIME")
	private Date operationTime;

	@Column(name="PAY_OR_NOT")
	private String payOrNot;

	@Temporal(TemporalType.DATE)
	@Column(name="VISIT_TIME")
	private Date visitTime;

	//bi-directional many-to-one association to Card
	@ManyToOne
	@JoinColumn(name="CRAD_ID")
	private Card card;

	//bi-directional many-to-one association to ChargeprojectTable
	@ManyToOne
	@JoinColumn(name="CHARGECODE")
	private ChargeprojectTable chargeprojectTable;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="STAFF_ID")
	private Staff staff;

	//bi-directional many-to-one association to HospEmerWaitDoctor
	@OneToMany(mappedBy="hospEmerRegistration")
	private List<HospEmerWaitDoctor> hospEmerWaitDoctors;

	//bi-directional many-to-one association to HospEmerWaitMedicine
	@OneToMany(mappedBy="hospEmerRegistration")
	private List<HospEmerWaitMedicine> hospEmerWaitMedicines;

	public HospEmerRegistration() {
	}

	public String getEmerRegistrationId() {
		return this.emerRegistrationId;
	}

	public void setEmerRegistrationId(String emerRegistrationId) {
		this.emerRegistrationId = emerRegistrationId;
	}

	public Date getOperationTime() {
		return this.operationTime;
	}

	public void setOperationTime(Date operationTime) {
		this.operationTime = operationTime;
	}

	public String getPayOrNot() {
		return this.payOrNot;
	}

	public void setPayOrNot(String payOrNot) {
		this.payOrNot = payOrNot;
	}

	public Date getVisitTime() {
		return this.visitTime;
	}

	public void setVisitTime(Date visitTime) {
		this.visitTime = visitTime;
	}

	public Card getCard() {
		return this.card;
	}

	public void setCard(Card card) {
		this.card = card;
	}

	public ChargeprojectTable getChargeprojectTable() {
		return this.chargeprojectTable;
	}

	public void setChargeprojectTable(ChargeprojectTable chargeprojectTable) {
		this.chargeprojectTable = chargeprojectTable;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public List<HospEmerWaitDoctor> getHospEmerWaitDoctors() {
		return this.hospEmerWaitDoctors;
	}

	public void setHospEmerWaitDoctors(List<HospEmerWaitDoctor> hospEmerWaitDoctors) {
		this.hospEmerWaitDoctors = hospEmerWaitDoctors;
	}

	public HospEmerWaitDoctor addHospEmerWaitDoctor(HospEmerWaitDoctor hospEmerWaitDoctor) {
		getHospEmerWaitDoctors().add(hospEmerWaitDoctor);
		hospEmerWaitDoctor.setHospEmerRegistration(this);

		return hospEmerWaitDoctor;
	}

	public HospEmerWaitDoctor removeHospEmerWaitDoctor(HospEmerWaitDoctor hospEmerWaitDoctor) {
		getHospEmerWaitDoctors().remove(hospEmerWaitDoctor);
		hospEmerWaitDoctor.setHospEmerRegistration(null);

		return hospEmerWaitDoctor;
	}

	public List<HospEmerWaitMedicine> getHospEmerWaitMedicines() {
		return this.hospEmerWaitMedicines;
	}

	public void setHospEmerWaitMedicines(List<HospEmerWaitMedicine> hospEmerWaitMedicines) {
		this.hospEmerWaitMedicines = hospEmerWaitMedicines;
	}

	public HospEmerWaitMedicine addHospEmerWaitMedicine(HospEmerWaitMedicine hospEmerWaitMedicine) {
		getHospEmerWaitMedicines().add(hospEmerWaitMedicine);
		hospEmerWaitMedicine.setHospEmerRegistration(this);

		return hospEmerWaitMedicine;
	}

	public HospEmerWaitMedicine removeHospEmerWaitMedicine(HospEmerWaitMedicine hospEmerWaitMedicine) {
		getHospEmerWaitMedicines().remove(hospEmerWaitMedicine);
		hospEmerWaitMedicine.setHospEmerRegistration(null);

		return hospEmerWaitMedicine;
	}

}